
    class load{
        constructor(){
            this.username=document.querySelector('#recipient-username')
            this.pwd=document.querySelector('#recipient-password')
            this.jz=document.querySelector('.che')
            this.btn=document.querySelector('.btn')
            this.zc=document.querySelector('.gologin')
            this.getmes()
            this.getlodemes()
            this.dengl()
            this.knowpwd()
        }
        getmes(){
            return JSON.parse(localStorage.getItem('abc')) || []
        }
        getlodemes(){
            return JSON.parse(localStorage.getItem('qwe')) || []
        }
        dengl(){
            this.btn.onclick=()=>{
                // debugger;
                var arr=this.getmes()
                if(arr.length>0){
                    var ret=arr.some((u)=>{
                        return u.username == this.username.value && u.pwd == this.pwd.value
                    })
                
                    if(ret){
                        alert('登录成功,请确认跳转')
                        var obj={
                            username:this.username.value,
                            pwd:this.pwd.value
                        }
                        let ar=[]
                       ar.push(obj)
                    localStorage.setItem('qwe',JSON.stringify(ar))
                        if(this.jz.checked==true){
                    //         var res=this.getlodemes()
                    // this.username.value=res[0].username
                    // this.pwd.value=res[0].pwd
                        }else{
                        //     this.username.value=''
                        // this.pwd.value=''
                        }
                        this.username.value=''
                        this.pwd.value=''
                        setTimeout(()=>{
                            location.href='../index.html'
                        },1500)
                    }else{
                        alert('登录失败')
                    }
                }
            }
        }
        knowpwd(){

        }
    }
    new load()
    console.log(11)
